package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.SystemMessage;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SystemMessageMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SystemMessage record);

    SystemMessage selectByPrimaryKey(Long id);

    List<SystemMessage> selectAll();

    int updateByPrimaryKey(SystemMessage record);

    List<SystemMessage> queryForList(QueryObject qo);

    /**
     * 获取未读取系统消息的数量
     * @param userId
     * @return
     */
    int getNoReadCount(@Param("userId") Long userId);

    /**
     * 设置系统消息为读取状态
     * @param userId
     */
    void setRead(@Param("userId") Long userId);
}